package dao;

// Generated Mar 18, 2014 10:39:39 PM by Hibernate Tools 3.4.0.CR1
import java.util.List;
import javax.naming.InitialContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Example;
import pojo.Attribute;
import pojo.DeletedMobiles;
import pojo.Mobile;

/**
 * Home object for domain model class Attribute.
 *
 * @see pojo.Attribute
 * @author Hibernate Tools
 */
public class DeletedMobilesHome {

    private static final Log log = LogFactory.getLog(AttributeHome.class);

    private final Session session;

    public DeletedMobilesHome(Session session) {
        this.session = session;
    }

    public void persist(DeletedMobiles attribute) {
        log.debug("persisting DeletedMobiles instance");
        try {
            session.beginTransaction();
            session.persist(attribute);
            session.getTransaction().commit();
            log.debug("persist successful");
        } catch (RuntimeException re) {
            log.error("persist failed", re);
            throw re;
        }
    }

    public void delete(DeletedMobiles attribute) {
        log.debug("deleting DeletedMobiles instance");
        try {
            session.beginTransaction();
            session.delete(attribute);
            session.getTransaction().commit();
            log.debug("delete successful");
        } catch (RuntimeException re) {
            log.error("delete failed", re);
            throw re;
        }
    }

    public void add(Mobile mobileById) {
        persist(new DeletedMobiles(mobileById));
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}
